(Pick attack type based on four different levels of charging.  If firing
 Thunder Ball from Bazooka, either decrement ammo count, or switch to
 Bazooka bludgeon attack if the chosen ammo is gone.)

90/82D8: A4 4C        LDY $4C
90/82DA: BE 60 00     LDX $0060,Y   (get pointer to potential attacker's stats)
90/82DD: B9 2E 00     LDA $002E,Y   (get potential attacker's current charge value.
                                     this is obvious enough on the boy and dog with
                                     their gauges, though i'm not sure how it works
                                     with enemies.)
90/82E0: C9 00 04     CMP #$0400
90/82E3: 90 2E        BCC $8313     (branch if meter < 100%)
90/82E5: C9 00 08     CMP #$0800
90/82E8: 90 23        BCC $830D     (branch if meter at least 100%, but not yet
                                     a full thin bar)
90/82EA: C9 00 0C     CMP #$0C00
90/82ED: 90 0F        BCC $82FE     (branch if at least a full thin bar, but not
                                     yet a full thick bar)
90/82EF: B9 14 00     LDA $0014,Y
90/82F2: 09 00 02     ORA #$0200
90/82F5: 99 14 00     STA $0014,Y     (???)
90/82F8: BF 3E 00 8E  LDA $8E003E,X   (attack to do if charged to level 3)
90/82FC: 80 19        BRA $8317
90/82FE: B9 14 00     LDA $0014,Y
90/8301: 09 00 02     ORA #$0200
90/8304: 99 14 00     STA $0014,Y     (i just said i don't know what it is! :P
                                       but i do know a pattern when i see one...)
90/8307: BF 3C 00 8E  LDA $8E003C,X   (attack to do if charged to level 2)
90/830B: 80 0A        BRA $8317
90/830D: BF 3A 00 8E  LDA $8E003A,X   (attack to do if 100% charged)
90/8311: 80 04        BRA $8317
90/8313: BF 38 00 8E  LDA $8E0038,X   (attack to do if < 100% charged)
90/8317: F0 40        BEQ $8359      (if the attack is null, just exit.  probably
                                      just a possibility for enemies.)
90/8319: C9 CA 41     CMP #$41CA
90/831C: D0 20        BNE $833E      (branch if the attack is not a Thunder Ball
                                      shot.)
90/831E: AD 49 23     LDA $2349      (get ammunition type of currently chosen
                                      shell.  0 = Thunder Ball, 2 = Particle Bomb,
                                      4 = Cryo Blast.  oh ho, but we already know
                                      it's Thunder Ball, since the above check
                                      didn't account for the other two projectiles.
                                      and that's our bug.)
90/8321: 29 FE 00     AND #$00FE
90/8324: 4A           LSR
90/8325: AA           TAX            (now it's 0 = Thunder Ball,
                                      1 = Particle Bomb, 2 = Cryo Blast)
90/8326: BD 45 23     LDA $2345,X
90/8329: 29 FF 00     AND #$00FF     (get ammunition count)
90/832C: D0 05        BNE $8333      (branch if we have some left)
90/832E: A9 EE 3E     LDA #$3EEE
90/8331: 80 0B        BRA $833E      (if there's none left, use the bazooka
                                      bludgeon attack instead.  this should
                                      match whatever value was in $8E0038,X
                                      above.)
90/8333: E2 20        SEP #$20
90/8335: 3A           DEC
90/8336: 9D 45 23     STA $2345,X    (decrement ammunition count)
90/8339: C2 30        REP #$30
90/833B: A9 CA 41     LDA #$41CA     (restore Thunder Ball attack type)
90/833E: AA           TAX
90/833F: BF 02 00 C4  LDA $C40002,X
90/8343: 89 00 40     BIT #$4000
90/8346: F0 0E        BEQ $8356
90/8348: 86 12        STX $12
90/834A: BE 22 00     LDX $0022,Y
90/834D: BF 5B 81 90  LDA $90815B,X
90/8351: 99 22 00     STA $0022,Y
90/8354: A6 12        LDX $12
90/8356: 4C 1B 81     JMP $811B
90/8359: 6B           RTL

